package cc.yugu.yhdw.webserver.service.basic;

import cc.yugu.yhdw.common.domain.basic.AppGrade;
import cc.yugu.yhdw.common.entity.pagination.Page;
import cc.yugu.yhdw.webserver.persistence.basic.AppGradeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 评分功能业务
 * 
 * @Date:Created in 2018/7/3 14:00
 * @Author:
 * @Modified By: zjn 2018/7/3 14:00
 */ 
@Service
public class AppGradeService {
    @Autowired
    AppGradeMapper appGradeMapper;

    public AppGrade find(int id) {
        return appGradeMapper.find(id);
    }
    /**
    * 分页查询
    * 
    * @Param: [search]
    * @Return: cc.yugu.yhdw.common.entity.pagination.Page
    * @Author By: zjn 2018/7/3  14:01
    */ 
    public Page findPage(AppGrade search) {
        Page page = search.buildPage();
        page.setTotalItems(appGradeMapper.findPageCount(search));
        search.setBeginIndex(page.getOffset());
        page.setResult(appGradeMapper.findPageResult(search));
        return page;
    }
    /**
    * 删除
    *
    * @Param: [id]
    * @Return: int
    * @Author By: zjn 2018/7/3  14:01
    */
    public int delete(int id) {
        return appGradeMapper.delete(id);
    }

}
